<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
  <style>
    @keyframes ani1 {
      0%{
        transform:translateX(-500px) rotate(720deg);
      
      }
      25%{
        transform:translateX(-200px) rotate(360deg);
      }
      50%{
        transform: translateX(-200px) rotate(360deg) scale(2);
      }
      75%{
        transform: translateX(-200px) translateY(200px) rotate(180deg) scale(1);
      }
      100%{
        transform: translateX(-0px) translateY(0px) rotate(0deg) scale(1);
      }
    }
    .box{
      width:150px;
      height: 150px;
      background: rgb(189, 139, 31);
      margin:50px auto;
    }
    .ani-enter-active{
      animation: ani1 3s;
    }
    .ani-leave-active{
      animation: ani1 3s;
    }
   
  </style>
</head>
<body>
  <div id="app">
    <button @click="isShow = !isShow">{{ isShow?'隐藏':'显示' }}</button>
    <transition name="ani">
      <div class="box" v-show="isShow"></div>
    </transition>
  </div>
  <script>
    let vm = new Vue({
      data:{
        isShow:false
      },
      el:"#app"
    })
  </script>
</body>
</html>